#ifndef BROADCAST_H
#define BROADCAST_H

#include <QDialog>
#include <QUdpSocket>
#include <QDebug>
#include <QByteArray>
#include <QHostAddress>
#include <QObject>
#include <QTcpSocket>
#include <QTextStream>
#include <QMessageBox>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QFile>
#include <QTimer>
#include <QDateTime>
#include <qmqtt_message.h>
#include "globalval.h"

namespace Ui {
class broadcast;
}

class broadcast : public QDialog
{
    Q_OBJECT

public:
    explicit broadcast(QWidget *parent = 0);
    ~broadcast();

private:
    Ui::broadcast *ui;
    QUdpSocket *udpSocket;
    QTcpSocket *tcpSocket;
    QTimer *timer;//创建定时器对象
private slots:
    void sendBroadcastMessageslot();//发送udp广播
    void readyReadSlot();//有udp信息可读时
    void connectSlot();//tcpsocket信号来时触发的槽函数
    void btnConnectSlot();//点击连接触发的槽函数
    void readyReadSlot2();//tcp信号有信息可读
    void timeoutSlot();//超时
    void comboxChangedSlot(int); // 数据上报模式改变
};

#endif // BROADCAST_H
